//网页一进来就调用
$(function () {
    var username = sessionStorage.getItem("username");
    if (username != null) {
        $("#loginUser").html(username);
    }
    //搜索
    $("#searchProduct").click(function () {
        let search = $("#searchContent").val();
        window.location.href = "search.html?search=" + search;
    })
})
//退出登录
function logout() {
    sessionStorage.removeItem("username");
    sessionStorage.removeItem("role");
    //刷新网页
    window.location.reload();
}


